
#include "ssdom.h"

#ifndef SSHTML_H
#define SSHTML_H

#define GC_HTML         "HTML"
#define GC_HEAD         "HEAD"
#define GC_BODY         "BODY"
#define GC_PARAGRAPH    "P"
#define GC_REFERENCE    "href"
#define GC_TABLE        "TABLE"
#define GC_TABLE_ROW    "TR"
#define GC_TABLE_DATA   "TD"
#define GC_TABLE_HEADER "TH"
#define GC_TITLE        "TITLE"
#define GC_CAPTION      "CAPTION"
#define GC_BGCOLOR      "BGCOLOR"

class SSHTML : public SSDOM
{
public:
    SSHTML();
    SSHTML(const char*);
   ~SSHTML();

    void endHtml();
    void makeHtml();
    void writeHtml();
    void makeParagraph(const char*,SSLeaf *n = NULL);
    void openParagraph();
    void closeParagraph();
    void makeData(const char*,SSLeaf *n = NULL);
    void makeLink(const char*, const char*,SSLeaf *n = NULL);
    void makeHeading(const char*,SSLeaf *n = NULL,unsigned level=1);
    void makeImage(const char*);
    void gotoBody();
    void setTable(SSLeaf*);
    void setTableRow(SSLeaf*);
    void openTable(const char*);
    void openTableRow();
    void closeTable();
    void closeTableRow();
    void setTableData(const char*);
    void setTableHeader(const char*);
    void getNextTable(SSLeaf*);
    void getNextRow(SSLeaf*);
    SSLeaf* getTable(){return table;}
    SSLeaf* getRow(){return row;}
    
    void setBackgroundColor(const char*);
    void setWidth(const char*);
private:
    SSLeaf *table;
    SSLeaf *row;
    
    bool table_open;
    bool table_row_open;
    char background_color[7];
    char width[7];
    char align[7];
};

#endif
